package elijah.base.utils;

import java.util.Locale;

public class Times {

    public static String stamp2HHMMSS(long time) {

        return String.format(Locale.CHINA, "%02d:%02d:%02d", time / 3600, Math.abs(time % 3600 / 60), Math.abs(time % 3600 % 60));
    }

    public static String stamp2HHMM(long time) {
        return String.format(Locale.CHINA, "%02d:%02d", time / 3600, Math.abs(time % 3600 / 60));
    }

    public static String stamp2MMSS(long time) {
        return String.format(Locale.CHINA, "%02d:%02d", Math.abs(time / 60), Math.abs(time % 3600 % 60));
    }
}
